<template>
    <div class="app-container">
        <MyHeader :title="title"/>
        <MyGoods v-for="item in list" :key="item.id"  :goods="item"/>
        <MyFooter :list="list"/>
    </div>
</template>

<script>
/* goods_count  goods_img   goods_name  goods_price  goods_state  id */
import MyHeader from './components/MyHeader.vue'
import MyGoods from './components/MyGoods.vue'
import MyFooter from './components/MyFooter.vue'
export default {
    name: 'ShopcarApp',
    components:{
        MyFooter,
        MyGoods,
        MyHeader

    },
    /* 发送axios请求 */
    async created() {
     let res= await this.$axios({
         url:'/api/cart'
     })
     
     this.list=res.data.list
     console.log(this.list);
    },

    data() {
        return {
            title:'购物车',
            list:[]
        };
    },

    mounted() {
        
    },

    methods: {
        
    },
};
</script>

<style lang="less" scoped>
.app-container {
  padding: 45px 0 50px 0;
}
</style>